package marchingCubes;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Vector;

import simpleGeom.Face3D;
import simpleGeom.MMesh;
import simpleGeom.SimpleTriangle;
import simpleGeom.Vec3D;

public class MCubeEngineLowMemory {
	Vector<MCEdge> edges;
	public void initCubes(float[][][] values, float iso) {
		int nX = values.length;
		int nY = values[0].length;
		int nZ = values[0][0].length;
		for (int x = 0; x < nX - 1; x++) {
			for (int y = 0; y < nY - 1; y++) {
				for (int z = 0; z < nZ - 1; z++) {
					
				}
			}
		}
	}
	public void initCubes(IsMCVertex[][][] values, float iso) {

		int nX = values.length;
		int nY = values[0].length;
		int nZ = values[0][0].length;

		Vector<MCEdge> edges = new Vector<MCEdge>();
		// cubes erstellen
		Vector<MCube> cubes = new Vector<MCube>();

		for (int x = 0; x < nX - 1; x++) {
			for (int y = 0; y < nY - 1; y++) {
				for (int z = 0; z < nZ - 1; z++) {
					MCube c = new MCube();
					IsMCVertex[] cV = new IsMCVertex[8];

					/*
					 * 0:0,1,0 1:1,1,0 2:1,0,0 3:0,0,0
					 */
					cV[0] = values[x][y + 1][z];
					cV[1] = values[x + 1][y + 1][z];
					cV[2] = values[x + 1][y][z];
					cV[3] = values[x][y][z];

					cV[4] = values[x][y + 1][z + 1];
					cV[5] = values[x + 1][y + 1][z + 1];
					cV[6] = values[x + 1][y][z + 1];
					cV[7] = values[x][y][z + 1];
					int nIn = 0;
					int nOut = 0;
					for (int i = 0; i < cV.length; i++) {
						float value = cV[i].getValue();
						if (value < iso)
							nIn++;
						if (value >= iso)
							nOut++;
					}

					if (nIn > 0 && nOut > 0) {

						c.v = cV;
						cV[0].setCube(c);
						MCEdge[] cE = new MCEdge[12];

						/*
						 * cE[0] = addEdge(x,y+1,z,x+1,y+1,z,values); //1|0
						 * cE[1] = addEdge(x+1,y,z,x+1,y+1,z,values); // 0|1
						 * 
						 * cE[2] = addEdge(x,y,z,x+1,y,z,values); // 0 cE[3] =
						 * addEdge(x,y,z,x,y+1,z,values); // 1
						 * 
						 * cE[4] = addEdge(x,y+1,z+1,x+1,y+1,z+1,values);//1|2|1
						 * cE[5] = addEdge(x+1,y,z+1,x+1,y+1,z+1,values);//0|2|1
						 * cE[6] = addEdge(x,y,z+1,x+1,y,z+1,values);//2|0 cE[7]
						 * = addEdge(x,y,z+1,x,y+1,z+1,values);//2|1
						 * 
						 * cE[8] = addEdge(x,y+1,z,x,y+1,z+1,values);//1|2 cE[9]
						 * = addEdge(x+1,y+1,z,x+1,y+1,z+1,values);//0|1|2
						 * 
						 * cE[10] = addEdge(x,y,z,x,y,z+1,values); //2
						 * 
						 * cE[11] = addEdge(x+1,y,z,x+1,y,z+1,values);//1|2
						 */

						c.edges = cE;

						cubes.add(c);
					}
				}
			}
		}

	}

	// this one is used
	public static Vector<SimpleTriangle> initCubesTest(IsMCVertex[][][] values,
			float iso, PrintWriter output) {
		int nX = values.length;
		int nY = values[0].length;
		int nZ = values[0][0].length;

		IsMCVertex[][][] vertices = values;
		Vector<MCEdge> edges = new Vector<MCEdge>();
		// cubes erstellen
		Vector<MCube> cubes = new Vector<MCube>();

		for (int x = 0; x < nX; x++) {
			for (int y = 0; y < nY; y++) {
				for (int z = 0; z < nZ; z++) {
					MCube cube = new MCube();
					IsMCVertex[] cV = new IsMCVertex[8];

					/*
					 * 0:0,1,0 1:1,1,0 2:1,0,0 3:0,0,0
					 */
					if (y < nY - 1)
						cV[0] = vertices[x][y + 1][z];
					if (y < nY - 1 && x < nX - 1)
						cV[1] = vertices[x + 1][y + 1][z];
					if (x < nX - 1)
						cV[2] = vertices[x + 1][y][z];
					cV[3] = vertices[x][y][z];
					if (y < nY - 1 && z < nZ - 1)
						cV[4] = vertices[x][y + 1][z + 1];
					if (x < nX - 1 && y < nY - 1 && z < nZ - 1)
						cV[5] = vertices[x + 1][y + 1][z + 1];
					if (x < nX - 1 && z < nZ - 1)
						cV[6] = vertices[x + 1][y][z + 1];
					if (z < nZ - 1)
						cV[7] = vertices[x][y][z + 1];
					int nIn = 0;
					int nOut = 0;
					for (int i = 0; i < cV.length; i++) {
						if (cV[i] != null) {
							float value = cV[i].getValue();
							if (value <= iso)
								nIn++;
							if (value >= iso)
								nOut++;
						}
					}

					if (nIn > 0 && nOut > 0) {

						cube.v = cV;
						cV[3].setCube(cube);

						MCEdge[] cE = new MCEdge[12];
						if (x < nX - 1) {
							cE[0] = new MCEdge(vertices[x][y][z],
									vertices[x + 1][y][z]);
							edges.add(cE[0]);
						}
						if (y < nY - 1) {
							cE[1] = new MCEdge(vertices[x][y][z],
									vertices[x][y + 1][z]);
							edges.add(cE[1]);
						}
						if (z < nZ - 1) {
							cE[2] = new MCEdge(vertices[x][y][z],
									vertices[x][y][z + 1]);
							edges.add(cE[2]);
						}
						cube.edges = cE;
						if (x < nX - 1 && y < nY - 1 && z < nZ - 1) {
							cubes.add(cube);
						}
					}
				}
			}
		}
		for (int i = 0; i < edges.size(); i++) {
			edges.get(i).calculateMidPoint(iso);
		}
		if (output == null) {
			Vector<SimpleTriangle> faces = new Vector<SimpleTriangle>();
			
			for (int i = 0; i < cubes.size(); i++) {
				
				faces.addAll(cubes.get(i).getSimpleTriangles(iso));
			}
			
			return faces;
		} else {
			int idV = 1;
			for (int i = 0; i < cubes.size(); i++) {
				Vector<SimpleTriangle> tris = cubes.get(i).getSimpleTriangles(
						iso);
				for (int j = 0; j < tris.size(); j++) {
					SimpleTriangle tri = tris.get(j);
					for (int l = 0; l < tri.getNodesNum(); l++) {
						Vec3D n = (Vec3D) tri.getNode(l);
						if (n.getId() == 0) {
							n.setId(idV);
							idV++;
							output.println("v " + n.x + " " + n.y + " " + n.z);
						}
					}
				}
			}

			for (int i = 0; i < cubes.size(); i++) {
				Vector<SimpleTriangle> tris = cubes.get(i).getSimpleTriangles(
						iso);
				for (int j = 0; j < tris.size(); j++) {
					SimpleTriangle tri = tris.get(j);
					
					String string = "f";
					for (int l = 0; l < tri.getNodesNum(); l++) {
						Vec3D n = (Vec3D) tri.getNode(l);
						string += " " + n.getId();
					}
					output.println(string);
				}
			}
		}
		return null;
	}
	public static Vector<SimpleTriangle> initCubesTestBuffered(IsMCVertex[][][] values,
			float iso, BufferedWriter output) {
		return initCubesTestBuffered(values,iso,output,1,0,0,0);
	}
	public static Vector<SimpleTriangle> initCubesTestBuffered(IsMCVertex[][][] values,
			float iso, BufferedWriter output,float scale,float tX,float tY,float tZ) {
		int nX = values.length;
		int nY = values[0].length;
		int nZ = values[0][0].length;

		IsMCVertex[][][] vertices = values;
		Vector<MCEdge> edges = new Vector<MCEdge>();
		// cubes erstellen
		Vector<MCube> cubes = new Vector<MCube>();

		for (int x = 0; x < nX; x++) {
			for (int y = 0; y < nY; y++) {
				for (int z = 0; z < nZ; z++) {
					MCube cube = new MCube();
					IsMCVertex[] cV = new IsMCVertex[8];
					/*
					 * 0:0,1,0 1:1,1,0 2:1,0,0 3:0,0,0
					 */
					if (y < nY - 1)
						cV[0] = vertices[x][y + 1][z];
					if (y < nY - 1 && x < nX - 1)
						cV[1] = vertices[x + 1][y + 1][z];
					if (x < nX - 1)
						cV[2] = vertices[x + 1][y][z];
					cV[3] = vertices[x][y][z];
					if (y < nY - 1 && z < nZ - 1)
						cV[4] = vertices[x][y + 1][z + 1];
					if (x < nX - 1 && y < nY - 1 && z < nZ - 1)
						cV[5] = vertices[x + 1][y + 1][z + 1];
					if (x < nX - 1 && z < nZ - 1)
						cV[6] = vertices[x + 1][y][z + 1];
					if (z < nZ - 1)
						cV[7] = vertices[x][y][z + 1];
					int nIn = 0;
					int nOut = 0;
					for (int i = 0; i < cV.length; i++) {
						if (cV[i] != null) {
							float value = cV[i].getValue();
							if (value <= iso)
								nIn++;
							if (value >= iso)
								nOut++;
						}
					}

					if (nIn > 0 && nOut > 0) {

						cube.v = cV;
						cV[3].setCube(cube);

						MCEdge[] cE = new MCEdge[12];
						if (x < nX - 1) {
							cE[0] = new MCEdge(vertices[x][y][z],
									vertices[x + 1][y][z]);
							edges.add(cE[0]);
						}
						if (y < nY - 1) {
							cE[1] = new MCEdge(vertices[x][y][z],
									vertices[x][y + 1][z]);
							edges.add(cE[1]);
						}
						if (z < nZ - 1) {
							cE[2] = new MCEdge(vertices[x][y][z],
									vertices[x][y][z + 1]);
							edges.add(cE[2]);
						}
						cube.edges = cE;
						if (x < nX - 1 && y < nY - 1 && z < nZ - 1) {
							cubes.add(cube);
						}
					}
				}
			}
		}
		System.out.println("MC edges ready");
		for (int i = 0; i < edges.size(); i++) {
			edges.get(i).calculateMidPoint(iso);
		}
		if (output == null) {
			Vector<SimpleTriangle> faces = new Vector<SimpleTriangle>();
			
			for (int i = 0; i < cubes.size(); i++) {
				
				faces.addAll(cubes.get(i).getSimpleTriangles(iso));
			}
			
			return faces;
		} else {
			int idV = 1;
			for (int i = 0; i < cubes.size(); i++) {
				Vector<SimpleTriangle> tris = cubes.get(i).getSimpleTriangles(
						iso);
				for (int j = 0; j < tris.size(); j++) {
					SimpleTriangle tri = tris.get(j);
					for (int l = 0; l < tri.getNodesNum(); l++) {
						Vec3D n = (Vec3D) tri.getNode(l);
						if (n.getId() == 0) {
							n.setId(idV);
							n.x*=scale;
							n.y*=scale;
							n.z*=scale;
							n.x+=tX;
							n.y+=tY;
							n.z+=tZ;
							idV++;
							try {
								output.write("v " + n.x + " " + n.y + " " + n.z);
								output.newLine();
							} catch (IOException e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}
							
						}
					}
				}
			}

			for (int i = 0; i < cubes.size(); i++) {
				Vector<SimpleTriangle> tris = cubes.get(i).getSimpleTriangles(
						iso);
				for (int j = 0; j < tris.size(); j++) {
					SimpleTriangle tri = tris.get(j);
					
					String string = "f";
					for (int l = 0; l < tri.getNodesNum(); l++) {
						Vec3D n = (Vec3D) tri.getNode(l);
						string += " " + n.getId();
					}
					try {
						output.write(string);
						output.newLine();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					
				}
			}
		}
		return null;
	}
	public static float getValue(float iso, float v1,float v2){
		if (v2-v1<0.0001f) return 0;
		return (iso-v1)/(v2-v1);
		
	}
	public static MMesh initCubesTest(int nX,int nY,int nZ,float[] values,
			float iso) {
		
		// plane of vertices.
		
		int nYZ=nY*nZ;
		int nXYZ=nX*nY*nZ;
		int nVs=0;
		int index=0;
		MMesh mesh=new MMesh();
		for (int x=0;x<nX;x++){
			for (int y=0;y<nY;y++){
				for (int z=0;z<nZ;z++){
					float cV=values[index];
					if (x<nX-1){
						float xNb=values[index+nYZ];
						if (cV<iso!=xNb<iso){
							nVs++;
						}
					}
					if (y<nY-1){
						float yNb=values[index+nZ];
						if (cV<iso!=yNb<iso){
							nVs++;
						}
					}
					if (z<nZ-1){
						float zNb=values[index+1];
						if (cV<iso!=zNb<iso){
							nVs++;
						}
					}
					index++;
				}
			}
		}
		float[]xCors=new float[nVs];
		float[]yCors=new float[nVs];
		float[]zCors=new float[nVs];
		int[]xE=new int[nXYZ];
		int[]yE=new int[nXYZ];
		int[]zE=new int[nXYZ];
		nVs=0;
		index=0;
		
		for (int x=0;x<nX;x++){
			for (int y=0;y<nY;y++){
				for (int z=0;z<nZ;z++){
					float cV=values[index];
					if (x<nX-1){
						float xNb=values[index+nYZ];
						if (cV<iso!=xNb<iso){
							xCors[nVs]=getValue(iso,cV,xNb)+x;
							yCors[nVs]=y;
							zCors[nVs]=z;
							xE[index]=nVs;
							nVs++;
						}
					}
					if (y<nY-1){
						float yNb=values[index+nZ];
						if (cV<iso!=yNb<iso){
							xCors[nVs]=x;
							yCors[nVs]=getValue(iso,cV,yNb)+y;
							zCors[nVs]=z;
							yE[index]=nVs;
							nVs++;
						}
					}
					if (z<nZ-1){
						float zNb=values[index+1];
						if (cV<iso!=zNb<iso){
							xCors[nVs]=x;
							yCors[nVs]=y;
							zCors[nVs]=getValue(iso,cV,zNb)+z;
							zE[index]=nVs;
							nVs++;
						}
					}
					index++;
				}
			}
		}
		
		ArrayList<int[]>triangles=new ArrayList<int[]>();
		float[]nbs=new float[8];
		int[]edges=new int[12];
		
		index=0;
		for (int x = 0; x < nX; x++) {
			for (int y = 0; y < nY; y++) {
				for (int z = 0; z < nZ; z++) {
					if (x < nX - 1 && y < nY - 1 && z < nZ - 1) {
						int caseNumber = 0;
						
						nbs[0] = values[index + nZ];
						nbs[1] = values[index + nYZ + nZ];
						nbs[2] = values[index + nYZ];
						nbs[3] = values[index];
						nbs[4] = values[index + nZ + 1];
						nbs[5] = values[index + nYZ + nZ + 1];
						nbs[6] = values[index + nYZ + 1];
						nbs[7] = values[index + 1];

						/*
						 * cE[0] = addEdge(x,y+1,z,x+1,y+1,z,values); //1|0
						 * cE[1] = addEdge(x+1,y,z,x+1,y+1,z,values); // 0|1
						 * 
						 * cE[2] = addEdge(x,y,z,x+1,y,z,values); // 0 cE[3] =
						 * addEdge(x,y,z,x,y+1,z,values); // 1
						 * 
						 * cE[4] = addEdge(x,y+1,z+1,x+1,y+1,z+1,values);//1|2|0
						 * cE[5] = addEdge(x+1,y,z+1,x+1,y+1,z+1,values);//0|2|1
						 * cE[6] = addEdge(x,y,z+1,x+1,y,z+1,values);//2|0 cE[7]
						 * = addEdge(x,y,z+1,x,y+1,z+1,values);//2|1
						 * 
						 * cE[8] = addEdge(x,y+1,z,x,y+1,z+1,values);//1|2 cE[9]
						 * = addEdge(x+1,y+1,z,x+1,y+1,z+1,values);//0|1|2
						 * 
						 * cE[10] = addEdge(x,y,z,x,y,z+1,values); //2
						 * 
						 * cE[11] = addEdge(x+1,y,z,x+1,y,z+1,values);//0|2
						 */

						edges[0] = xE[index + nZ];
						edges[1] = yE[index + nYZ];
						edges[2] = xE[index];
						edges[3] = yE[index];
						edges[4] = xE[index + nZ + 1];
						edges[5] = yE[index + nYZ + 1];
						edges[6] = xE[index + 1];
						edges[7] = yE[index + 1];
						edges[8] = zE[index + nZ];
						edges[9] = zE[index + nYZ + nZ];
						edges[10] =zE[index ];
						edges[11] =zE[index + nYZ];

						for (int i = 7; i > -1; i--) {
							if (nbs[i] > iso) {
								caseNumber++;
							}
							if (i > 0) {
								caseNumber = caseNumber << 1;
							}
						}

						int offset = caseNumber * 15;
						for (int i = offset; i < offset + 15; i += 3) {
							if (faces[i] > -1) {
								int v0 = edges[faces[i]];
								int v1 = edges[faces[i + 1]];
								int v2 = edges[faces[i + 2]];
								int[] triangle = new int[] { v0, v1, v2 };
								triangles.add(triangle);
							}
						}
					}
					index++;
				}
			}
		}
		mesh.xc=xCors;
		mesh.yc=yCors;
		mesh.zc=zCors;
		
		mesh.triangles=new int[triangles.size()*3];
		for (int i=0;i<triangles.size();i++){
			int[]triangle=triangles.get(i);
			int cIndex=i*3;
			for (int j=0;j<triangle.length;j++){
				mesh.triangles[cIndex+j]=triangle[j];
			}
		}
		return mesh;
	}
	
	public void saveFaces() {

	}

	public Vector<Face3D> initCubesOct(OctCell rootCell, float iso) {
		Vector<OctCell> cells = new Vector<OctCell>();
		rootCell.collectAllEndChildren(cells);

		Vector<MCEdge> edges = new Vector<MCEdge>();
		Vector<MCube> cubes = new Vector<MCube>();

		float d = rootCell.minD;
		for (int i = 0; i < cells.size(); i++) {
			OctCell cell = cells.get(i);
			float x = cell.getCenterX();
			float y = cell.getCenterY();
			float z = cell.getCenterZ();
			MCube cube = new MCube();
			IsMCVertex[] cV = new IsMCVertex[8];

			cV[0] = rootCell.getCell(x, y + d, z);
			cV[1] = rootCell.getCell(x + d, y + d, z);
			cV[2] = rootCell.getCell(x + d, y, z);
			cV[3] = rootCell.getCell(x, y, z);
			cV[4] = rootCell.getCell(x, y + d, z + d);
			cV[5] = rootCell.getCell(x + d, y + d, z + d);
			cV[6] = rootCell.getCell(x + d, y, z + d);
			cV[7] = rootCell.getCell(x, y, z + d);

			int nIn = 0;
			int nOut = 0;
			for (int j = 0; j < cV.length; j++) {
				if (cV[j] != null) {
					float value = cV[j].getValue();
					if (value < iso)
						nIn++;
					if (value >= iso)
						nOut++;
				}
			}

			if (nIn > 0 && nOut > 0) {
				cube.v = cV;
				cV[3].setCube(cube);
				MCEdge[] cE = new MCEdge[3];
				OctCell xCell = rootCell.getCell(x + d, y, z);
				if (xCell != null) {
					cE[0] = new MCEdge(cell, xCell);
					edges.add(cE[0]);
				}
				OctCell yCell = rootCell.getCell(x, y + d, z);
				if (yCell != null) {
					cE[1] = new MCEdge(cell, yCell);
					edges.add(cE[1]);
				}
				OctCell zCell = rootCell.getCell(x, y, z + d);
				if (zCell != null) {
					cE[2] = new MCEdge(cell, zCell);
					edges.add(cE[2]);
				}

				cube.edges = cE;
				if (xCell != null && yCell != null && zCell != null) {
					cubes.add(cube);
				}
			}
		}
		Vector<Face3D> faces = new Vector<Face3D>();
		for (int i = 0; i < edges.size(); i++) {
			edges.get(i).calculateMidPoint(iso);
		}
		for (int i = 0; i < cubes.size(); i++) {
			faces.addAll(cubes.get(i).getTriangles(iso));
		}
		this.edges = edges;
		return faces;

	}
	private static int faces[] =
		{
		    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 8, 3, 1, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    9, 2, 11, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    2, 8, 3, 2, 11, 8, 11, 9, 8, -1, -1, -1, -1, -1, -1,
		    3, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 10, 2, 8, 10, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 9, 0, 2, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 10, 2, 1, 9, 10, 9, 8, 10, -1, -1, -1, -1, -1, -1,
		    3, 11, 1, 10, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 11, 1, 0, 8, 11, 8, 10, 11, -1, -1, -1, -1, -1, -1,
		    3, 9, 0, 3, 10, 9, 10, 11, 9, -1, -1, -1, -1, -1, -1,
		    9, 8, 11, 11, 8, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1,
		    1, 2, 11, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    3, 4, 7, 3, 0, 4, 1, 2, 11, -1, -1, -1, -1, -1, -1,
		    9, 2, 11, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1,
		    2, 11, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1,
		    8, 4, 7, 3, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    10, 4, 7, 10, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1,
		    9, 0, 1, 8, 4, 7, 2, 3, 10, -1, -1, -1, -1, -1, -1,
		    4, 7, 10, 9, 4, 10, 9, 10, 2, 9, 2, 1, -1, -1, -1,
		    3, 11, 1, 3, 10, 11, 7, 8, 4, -1, -1, -1, -1, -1, -1,
		    1, 10, 11, 1, 4, 10, 1, 0, 4, 7, 10, 4, -1, -1, -1,
		    4, 7, 8, 9, 0, 10, 9, 10, 11, 10, 0, 3, -1, -1, -1,
		    4, 7, 10, 4, 10, 9, 9, 10, 11, -1, -1, -1, -1, -1, -1,
		    9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1,
		    1, 2, 11, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    3, 0, 8, 1, 2, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1,
		    5, 2, 11, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1,
		    2, 11, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1,
		    9, 5, 4, 2, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 10, 2, 0, 8, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1,
		    0, 5, 4, 0, 1, 5, 2, 3, 10, -1, -1, -1, -1, -1, -1,
		    2, 1, 5, 2, 5, 8, 2, 8, 10, 4, 8, 5, -1, -1, -1,
		    11, 3, 10, 11, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1,
		    4, 9, 5, 0, 8, 1, 8, 11, 1, 8, 10, 11, -1, -1, -1,
		    5, 4, 0, 5, 0, 10, 5, 10, 11, 10, 0, 3, -1, -1, -1,
		    5, 4, 8, 5, 8, 11, 11, 8, 10, -1, -1, -1, -1, -1, -1,
		    9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1,
		    0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1,
		    1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    9, 7, 8, 9, 5, 7, 11, 1, 2, -1, -1, -1, -1, -1, -1,
		    11, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1,
		    8, 0, 2, 8, 2, 5, 8, 5, 7, 11, 5, 2, -1, -1, -1,
		    2, 11, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1,
		    7, 9, 5, 7, 8, 9, 3, 10, 2, -1, -1, -1, -1, -1, -1,
		    9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 10, -1, -1, -1,
		    2, 3, 10, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1,
		    10, 2, 1, 10, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1,
		    9, 5, 8, 8, 5, 7, 11, 1, 3, 11, 3, 10, -1, -1, -1,
		    5, 7, 0, 5, 0, 9, 7, 10, 0, 1, 0, 11, 10, 11, 0,
		    10, 11, 0, 10, 0, 3, 11, 5, 0, 8, 0, 7, 5, 7, 0,
		    10, 11, 5, 7, 10, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    11, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 8, 3, 5, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    9, 0, 1, 5, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 8, 3, 1, 9, 8, 5, 11, 6, -1, -1, -1, -1, -1, -1,
		    1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1,
		    9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1,
		    5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1,
		    2, 3, 10, 11, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    10, 0, 8, 10, 2, 0, 11, 6, 5, -1, -1, -1, -1, -1, -1,
		    0, 1, 9, 2, 3, 10, 5, 11, 6, -1, -1, -1, -1, -1, -1,
		    5, 11, 6, 1, 9, 2, 9, 10, 2, 9, 8, 10, -1, -1, -1,
		    6, 3, 10, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1,
		    0, 8, 10, 0, 10, 5, 0, 5, 1, 5, 10, 6, -1, -1, -1,
		    3, 10, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1,
		    6, 5, 9, 6, 9, 10, 10, 9, 8, -1, -1, -1, -1, -1, -1,
		    5, 11, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 3, 0, 4, 7, 3, 6, 5, 11, -1, -1, -1, -1, -1, -1,
		    1, 9, 0, 5, 11, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1,
		    11, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1,
		    6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1,
		    1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1,
		    8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1,
		    7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9,
		    3, 10, 2, 7, 8, 4, 11, 6, 5, -1, -1, -1, -1, -1, -1,
		    5, 11, 6, 4, 7, 2, 4, 2, 0, 2, 7, 10, -1, -1, -1,
		    0, 1, 9, 4, 7, 8, 2, 3, 10, 5, 11, 6, -1, -1, -1,
		    9, 2, 1, 9, 10, 2, 9, 4, 10, 7, 10, 4, 5, 11, 6,
		    8, 4, 7, 3, 10, 5, 3, 5, 1, 5, 10, 6, -1, -1, -1,
		    5, 1, 10, 5, 10, 6, 1, 0, 10, 7, 10, 4, 0, 4, 10,
		    0, 5, 9, 0, 6, 5, 0, 3, 6, 10, 6, 3, 8, 4, 7,
		    6, 5, 9, 6, 9, 10, 4, 7, 9, 7, 10, 9, -1, -1, -1,
		    11, 4, 9, 6, 4, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 11, 6, 4, 9, 11, 0, 8, 3, -1, -1, -1, -1, -1, -1,
		    11, 0, 1, 11, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1,
		    8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 11, -1, -1, -1,
		    1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1,
		    3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1,
		    0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1,
		    11, 4, 9, 11, 6, 4, 10, 2, 3, -1, -1, -1, -1, -1, -1,
		    0, 8, 2, 2, 8, 10, 4, 9, 11, 4, 11, 6, -1, -1, -1,
		    3, 10, 2, 0, 1, 6, 0, 6, 4, 6, 1, 11, -1, -1, -1,
		    6, 4, 1, 6, 1, 11, 4, 8, 1, 2, 1, 10, 8, 10, 1,
		    9, 6, 4, 9, 3, 6, 9, 1, 3, 10, 6, 3, -1, -1, -1,
		    8, 10, 1, 8, 1, 0, 10, 6, 1, 9, 1, 4, 6, 4, 1,
		    3, 10, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1,
		    6, 4, 8, 10, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    7, 11, 6, 7, 8, 11, 8, 9, 11, -1, -1, -1, -1, -1, -1,
		    0, 7, 3, 0, 11, 7, 0, 9, 11, 6, 7, 11, -1, -1, -1,
		    11, 6, 7, 1, 11, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1,
		    11, 6, 7, 11, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1,
		    1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1,
		    2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9,
		    7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1,
		    7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    2, 3, 10, 11, 6, 8, 11, 8, 9, 8, 6, 7, -1, -1, -1,
		    2, 0, 7, 2, 7, 10, 0, 9, 7, 6, 7, 11, 9, 11, 7,
		    1, 8, 0, 1, 7, 8, 1, 11, 7, 6, 7, 11, 2, 3, 10,
		    10, 2, 1, 10, 1, 7, 11, 6, 1, 6, 7, 1, -1, -1, -1,
		    8, 9, 6, 8, 6, 7, 9, 1, 6, 10, 6, 3, 1, 3, 6,
		    0, 9, 1, 10, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    7, 8, 0, 7, 0, 6, 3, 10, 0, 10, 6, 0, -1, -1, -1,
		    7, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    7, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    3, 0, 8, 10, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 1, 9, 10, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    8, 1, 9, 8, 3, 1, 10, 7, 6, -1, -1, -1, -1, -1, -1,
		    11, 1, 2, 6, 10, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 2, 11, 3, 0, 8, 6, 10, 7, -1, -1, -1, -1, -1, -1,
		    2, 9, 0, 2, 11, 9, 6, 10, 7, -1, -1, -1, -1, -1, -1,
		    6, 10, 7, 2, 11, 3, 11, 8, 3, 11, 9, 8, -1, -1, -1,
		    7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1,
		    2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1,
		    1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1,
		    11, 7, 6, 11, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1,
		    11, 7, 6, 1, 7, 11, 1, 8, 7, 1, 0, 8, -1, -1, -1,
		    0, 3, 7, 0, 7, 11, 0, 11, 9, 6, 11, 7, -1, -1, -1,
		    7, 6, 11, 7, 11, 8, 8, 11, 9, -1, -1, -1, -1, -1, -1,
		    6, 8, 4, 10, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    3, 6, 10, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1,
		    8, 6, 10, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1,
		    9, 4, 6, 9, 6, 3, 9, 3, 1, 10, 3, 6, -1, -1, -1,
		    6, 8, 4, 6, 10, 8, 2, 11, 1, -1, -1, -1, -1, -1, -1,
		    1, 2, 11, 3, 0, 10, 0, 6, 10, 0, 4, 6, -1, -1, -1,
		    4, 10, 8, 4, 6, 10, 0, 2, 9, 2, 11, 9, -1, -1, -1,
		    11, 9, 3, 11, 3, 2, 9, 4, 3, 10, 3, 6, 4, 6, 3,
		    8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1,
		    0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1,
		    1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1,
		    8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 11, 1, -1, -1, -1,
		    11, 1, 0, 11, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1,
		    4, 6, 3, 4, 3, 8, 6, 11, 3, 0, 3, 9, 11, 9, 3,
		    11, 9, 4, 6, 11, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 9, 5, 7, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 8, 3, 4, 9, 5, 10, 7, 6, -1, -1, -1, -1, -1, -1,
		    5, 0, 1, 5, 4, 0, 7, 6, 10, -1, -1, -1, -1, -1, -1,
		    10, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1,
		    9, 5, 4, 11, 1, 2, 7, 6, 10, -1, -1, -1, -1, -1, -1,
		    6, 10, 7, 1, 2, 11, 0, 8, 3, 4, 9, 5, -1, -1, -1,
		    7, 6, 10, 5, 4, 11, 4, 2, 11, 4, 0, 2, -1, -1, -1,
		    3, 4, 8, 3, 5, 4, 3, 2, 5, 11, 5, 2, 10, 7, 6,
		    7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1,
		    9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1,
		    3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1,
		    6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8,
		    9, 5, 4, 11, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1,
		    1, 6, 11, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4,
		    4, 0, 11, 4, 11, 5, 0, 3, 11, 6, 11, 7, 3, 7, 11,
		    7, 6, 11, 7, 11, 8, 5, 4, 11, 4, 8, 11, -1, -1, -1,
		    6, 9, 5, 6, 10, 9, 10, 8, 9, -1, -1, -1, -1, -1, -1,
		    3, 6, 10, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1,
		    0, 10, 8, 0, 5, 10, 0, 1, 5, 5, 6, 10, -1, -1, -1,
		    6, 10, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1,
		    1, 2, 11, 9, 5, 10, 9, 10, 8, 10, 5, 6, -1, -1, -1,
		    0, 10, 3, 0, 6, 10, 0, 9, 6, 5, 6, 9, 1, 2, 11,
		    10, 8, 5, 10, 5, 6, 8, 0, 5, 11, 5, 2, 0, 2, 5,
		    6, 10, 3, 6, 3, 5, 2, 11, 3, 11, 5, 3, -1, -1, -1,
		    5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1,
		    9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1,
		    1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8,
		    1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 3, 6, 1, 6, 11, 3, 8, 6, 5, 6, 9, 8, 9, 6,
		    11, 1, 0, 11, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1,
		    0, 3, 8, 5, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    11, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    10, 5, 11, 7, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    10, 5, 11, 10, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1,
		    5, 10, 7, 5, 11, 10, 1, 9, 0, -1, -1, -1, -1, -1, -1,
		    11, 7, 5, 11, 10, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1,
		    10, 1, 2, 10, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1,
		    0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 10, -1, -1, -1,
		    9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 10, 7, -1, -1, -1,
		    7, 5, 2, 7, 2, 10, 5, 9, 2, 3, 2, 8, 9, 8, 2,
		    2, 5, 11, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1,
		    8, 2, 0, 8, 5, 2, 8, 7, 5, 11, 2, 5, -1, -1, -1,
		    9, 0, 1, 5, 11, 3, 5, 3, 7, 3, 11, 2, -1, -1, -1,
		    9, 8, 2, 9, 2, 1, 8, 7, 2, 11, 2, 5, 7, 5, 2,
		    1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1,
		    9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1,
		    9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    5, 8, 4, 5, 11, 8, 11, 10, 8, -1, -1, -1, -1, -1, -1,
		    5, 0, 4, 5, 10, 0, 5, 11, 10, 10, 3, 0, -1, -1, -1,
		    0, 1, 9, 8, 4, 11, 8, 11, 10, 11, 4, 5, -1, -1, -1,
		    11, 10, 4, 11, 4, 5, 10, 3, 4, 9, 4, 1, 3, 1, 4,
		    2, 5, 1, 2, 8, 5, 2, 10, 8, 4, 5, 8, -1, -1, -1,
		    0, 4, 10, 0, 10, 3, 4, 5, 10, 2, 10, 1, 5, 1, 10,
		    0, 2, 5, 0, 5, 9, 2, 10, 5, 4, 5, 8, 10, 8, 5,
		    9, 4, 5, 2, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    2, 5, 11, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1,
		    5, 11, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1,
		    3, 11, 2, 3, 5, 11, 3, 8, 5, 4, 5, 8, 0, 1, 9,
		    5, 11, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1,
		    8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1,
		    0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1,
		    9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 10, 7, 4, 9, 10, 9, 11, 10, -1, -1, -1, -1, -1, -1,
		    0, 8, 3, 4, 9, 7, 9, 10, 7, 9, 11, 10, -1, -1, -1,
		    1, 11, 10, 1, 10, 4, 1, 4, 0, 7, 4, 10, -1, -1, -1,
		    3, 1, 4, 3, 4, 8, 1, 11, 4, 7, 4, 10, 11, 10, 4,
		    4, 10, 7, 9, 10, 4, 9, 2, 10, 9, 1, 2, -1, -1, -1,
		    9, 7, 4, 9, 10, 7, 9, 1, 10, 2, 10, 1, 0, 8, 3,
		    10, 7, 4, 10, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1,
		    10, 7, 4, 10, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1,
		    2, 9, 11, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1,
		    9, 11, 7, 9, 7, 4, 11, 2, 7, 8, 7, 0, 2, 0, 7,
		    3, 7, 11, 3, 11, 2, 7, 4, 11, 1, 11, 0, 4, 0, 11,
		    1, 11, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1,
		    4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1,
		    4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    9, 11, 8, 11, 10, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    3, 0, 9, 3, 9, 10, 10, 9, 11, -1, -1, -1, -1, -1, -1,
		    0, 1, 11, 0, 11, 8, 8, 11, 10, -1, -1, -1, -1, -1, -1,
		    3, 1, 11, 10, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 2, 10, 1, 10, 9, 9, 10, 8, -1, -1, -1, -1, -1, -1,
		    3, 0, 9, 3, 9, 10, 1, 2, 9, 2, 10, 9, -1, -1, -1,
		    0, 2, 10, 8, 0, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    3, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    2, 3, 8, 2, 8, 11, 11, 8, 9, -1, -1, -1, -1, -1, -1,
		    9, 11, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    2, 3, 8, 2, 8, 11, 0, 1, 8, 1, 11, 8, -1, -1, -1,
		    1, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
		};

}
